package cmd.commands;

import platform.PlatformObjectFactory;
import util.PlayerUtilities;


public class SetVolumeCommand extends Command {

	public SetVolumeCommand(Command c) {
		super(c.command, c.parameters);
	}

	@Override
	public boolean execute() {
		PlatformObjectFactory.getInstance().getCommandExecutor().setVolume(1);
		int para = 0;
		try
		{
			int[] deleteList = this.getIntegerParameterList();
			if (deleteList == null) {
				para = 0;
			}
			else
			{
				if(deleteList.length > 0)
					para = deleteList[0];
				else
					para = 0;
			}
		}
		catch(Exception e)
		{

		}
		PlayerUtilities.setUpdateStringJson("SET_VOLUME",para);
		return true;
	}

}
